<template>
	<view>
		<image :src="markerInfo.attractionsPicture" style="width: 100%;height: 200px;"></image>
		<text class="scenicTitle">{{markerInfo.title}}</text>
		<view class="goHere" @click="goHere">
			<u-icon name="tags-fill"></u-icon>
			<text>100km</text>
			<u-icon name="map"></u-icon>
			<text>到这里</text>
		</view>
		<view class="goHere">
			<u-icon name="clock"></u-icon>
			<text>{{markerInfo.attractionsStart}}-{{markerInfo.attractionsEnd}}</text>
		</view>
		<view class="content">
			<u-tag text="内容介绍" type="success" plain size="mini"
				icon="https://cdn.uviewui.com/uview/example/tag.png"></u-tag>
		</view>
		<view class="detailedIntro">
			<u--text :lines="4" :text="markerInfo.attractionsIntroduction"></u--text>
		</view>


	</view>
</template>

<script>
	import * as scenicSpots from '@/api/spotApi/spotManage.js'
	export default {
		data() {
			return {
				markerInfo: '', //景点信息
				pictureUrl:''
			}
		},
		methods: {
			goHere() {
				console.log("出发")
			},
			//根据id获取景点信息
			getSoptInfo(spotId){
				scenicSpots.getSpot(spotId).then(resp=>{
					console.log(resp)
					var markerInfo=resp.data
					markerInfo.attractionsPicture='http:'+"//"+markerInfo.attractionsPicture;
					this.markerInfo=markerInfo
					console.log("景点景点！！！",this.markerInfo)
					
				})
			}
			
		},
		mounted() {
			//获取传递过来的参数
			var spotId = JSON.parse(this.$root.$mp.query.spotId);
			console.log('spotId',spotId)
			this.getSoptInfo(spotId)
			this.pictureUrl='http:'+"//"+this.markerInfo.attractionsPicture
			console.log('图片地址',this.pictureUrl)
		}
	}
</script>

<style scoped>
	.scenicTitle {
		padding-left: 15px;
		font-size: 20px;
		color: orangered;
	}

	.goHere {
		display: flex;
		padding-left: 15px;
		padding-top: 10px;
	}

	.content {
		display: flex;
		justify-content: center;

	}

	.detailedIntro {

		position: absolute;
		width: 87%;
		height: 100px;
		background-color: #fff;
		border-radius: 10px;
		box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
		padding: 10px 10px 10px 10px;
		margin: 10px 10px 0px 10px;
		overflow: hidden;
		transition: transform 0.3s ease-in-out;
		line-height: 25px;
	}
</style>